﻿@using SH = EMoney.IStock.Client.Framework.StringHelper;

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>2014腾讯A股大赛</title>
    <link rel="stylesheet" type="text/css" href="@ViewBag.PageCss" id="linkcss" />
    <script src="http://static.emoney.cn/js/libs/jquery.min.1.8.3.js" type="text/javascript"></script>
</head>
<body class="enroll">
    <div class="enroll_main">
        <div id="divHtml">
            <div class="enroll_txt">
                <p>报名成功：你已经成功领取10万元虚拟奖励资金。</p>
                <p><span class="light_c">快来抢10元话费充值</span>，试试手气吧！</p>
            </div>
            <a class="enroll_yes" hidefocus="true" href="javascript:;" id="lottery">点击礼盒进行抽奖</a>
        </div>        
        <div class="textr"><a class="enter_game" hidefocus="true" href="javascript:;">进入大赛>></a></div>
    </div>
    <div class="enroll_pop" style="display:none;">
        <div class="p1">
            <div class=" bound_tit">抽话费</div>
            <div class="fr"><a hidefocus="true" href="javascript:;">
                <img src="@SH.GetStaticFile("IStockClientStatic/qq/images/blank.gif")" width="30" height="30" alt="" /></a></div>
            <div class="clear"></div>
        </div>
        <div class="p2">您确定要放弃此次抽奖机会吗？</div>
        <div class="p3"><a hidefocus="true" href="javascript:;" id="abandon">确定</a> <a hidefocus="true" id="cancel" href="javascript:;">取消</a></div>
    </div>
    <input type="hidden" id="hidColor" value="@ViewBag.Color" />

    <script type="text/javascript" src="@SH.GetStaticFile("IStockClientStatic/js/jquery.blockUI.js")"></script>
    <script type="text/javascript" src="@SH.GetStaticFile("IStockClientStatic/js/istockfunc.js")"></script>
</body>
</html>
<script type="text/javascript">
    var www = "@Url.Content("~/")",islottery = "";

    $(document).ready(function () {
        $("#lottery").click(function () {
            $.ajax({
                type: "post",
                url: www + "qq/lty",
                data: {},
                datatype: "text",
                success: function (data) {
                    switch (data) {
                        case "0":
                            $("#divHtml").html("<div class='enroll_nomoney'><p style='font-size:30px;'>很可惜</p><p>没能抢到话费</p></div>");
                            break;
                        case "1":
                            $("#divHtml").html("<div class='enroll_money'><p style='font-size:30px;'>恭喜您</p><p>抢得10元话费</p></div><div class='enroll_m1'>系统将在24小时内为您报名参赛的手机号码充值</div>");
                            break;
                        default:
                            break;
                    }

                    islottery = "1";
                },
                beforeSend: function () {
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    //alert(XMLHttpRequest.status);
                }
            });
        });

        $(".fr").click(function () {
            $.unblockUI();
            $(".blockUI").fadeOut("slow");
        });

        $("#cancel").click(function () {
            $.unblockUI();
            $(".blockUI").fadeOut("slow");
        });

        $("#abandon").click(function () {
            $.ajax({
                type: "post",
                url: www + "qq/abandon",
                data: { },
                datatype: "text",
                success: function (data) {
                    window.location.href = www + "qq";
                },
                beforeSend: function () {
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    //alert(XMLHttpRequest.status);
                }
            });
        });

        $(".enter_game").click(function () {
            if (islottery == "") {
                var left = (document.body.clientWidth - 390) / 2;
                var top = (document.body.clientHeight - 170) / 2;

                $.blockUI({ message: $('.enroll_pop'), css: { top: top, left: left, width: '390', height: '170' } });
            }
            else {
                window.location.href = www + "qq";
            }
        });
    });

    function OnSkinChanged(skinName) {
        var cssHref = "";

        switch (skinName) {
            case "default":
                hidColor = skinName;
                cssHref = $("#hidWhiteCss").val();
                break;
            case "black":
                hidColor = skinName;
                cssHref = $("#hidBlackCss").val();
                break;
            default:
                break;
        }

        if (cssHref != "") {
            $("#linkcss").attr("href", cssHref);
        }
    }
</script>
